#define _CRT_SECURE_NO_WARNINGS 1

#include "List.h"

void TestList1()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);

	LTPrint(plist);
	
	LTPopBack(plist);
	LTPrint(plist);
	LTPopBack(plist);
	LTPrint(plist);
	
}

void TestList2()
{
	LTNode* plist = LTInit();
	LTPushFront(plist, 5);
	LTPushFront(plist, 6);
	LTPushFront(plist, 7);
	LTPushFront(plist, 8);

	LTPrint(plist);

	LTPopFront(plist);
	LTPrint(plist);
	LTPopFront(plist);
	LTPrint(plist);
	
}

void TestList3()
{
	LTNode* plist = LTInit();
	LTPushFront(plist, 5);
	LTPushFront(plist, 6);
	LTPushFront(plist, 7);
	LTPushFront(plist, 8);

	LTPrint(plist);

	LTNode* pdata= LTFind(plist, 5);
	if (pdata)
	{
		LTErase(pdata);
		LTPrint(plist);
		pdata = NULL;
	}
	pdata = LTFind(plist, 7);
	LTInsert(pdata, 27);
	LTPrint(plist);
	pdata = NULL;

	LTDestroy(plist);
	plist = NULL;
}
int main()
{
	//TestList1();
	//TestList2();
	TestList3();
	return 0;
}